home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: ncrgw2.ncr.com!ncrhub2!lznj2!lziss3!netnews
- From: Arnold Bursian <arnold.bursian@germany.ncr.com>
- Subject: Re: Need help making C program, C++
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <31401309.5E0F@germany.ncr.com>
- Sender: netnews@lziss3.lincroftnj.ncr.com (51[news]-Netnews Admin)
- Content-Transfer-Encoding: 7bit
- Organization: AT&T GIS Lincroft, NJ USA
- References: <313E7AE3.6F9C@cp.duluth.mn.us>
- Mime-Version: 1.0
- Date: Fri, 8 Mar 1996 10:59:21 GMT
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- Yan Saillard wrote:
- >
- > I'm writing a calculator program for a class assignment and its already
- > done in C and I wanted to "convert it" to C++. Any help would be
- > appreciated!
- >
- > Here's the messages I got after compiling it (turbo c++ 3.1) with the
- > lines below.
- >
- > *Warning CALK.CPP 19: Style of function definition is now obsolete
- > int doOp(o,r) char o; int r;
- >
- > *Warning CALK.CPP 30: Style of function definition is now obsolete:
- > void showResult(r) int r;
- >
- > What would be the way C++ defines functions?
- >
- > *Error CALK.CPP 39: Function 'getchar' should have a prototype
- > while((op = getchar()) != 'q')
- >
- > this program ran fine in C.
- >
- > Thanks!
-
- Use following definition for questions 1&2
-
- 1: int doOp(char o, int r);
-
- 2: void showResult( int r);
-
- For question 3: Make sure you included 'stdio.h'
-